//
//  LJServer.h
//  LJClientKit
//
//  Created by che on 12/7/09.
//  Copyright 2009 AntonChebotaev. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import <XMLRPC/XMLRPC.h>
#import "LJEntry.h"
#import "LJCommunicationContract.h"

@class LJEntry;

// Exceptions
FOUNDATION_EXPORT NSString * const LJServerBadInitException;

// Useragent
FOUNDATION_EXPORT NSString * const LJServerDefaultClientVersion;

// Notifications
FOUNDATION_EXPORT NSString * const LJServerLivejournalErrorNotification;
FOUNDATION_EXPORT NSString * const LJServerResponceErrorNotification;

@class LJAccount;

@interface LJServer : NSObject <NSCoding> {
    NSURL * serverURL;
	NSString * clientVersion;
}

@property (readonly) NSURL * 				serverURL;
@property (readwrite, retain) NSString * 	clientVersion;

- (id)initWithURL:(NSURL *)url;

#pragma mark -
#pragma mark Server messages

- (LJResponseDictionary *)loginForUsername:(NSString *)anUsername password:(NSString *)aPassword;
- (LJResponseDictionary *)friendsForUsername:(NSString *)anUsername password:(NSString *)aPassword;
- (LJResponseDictionary *)tagsForUsername:(NSString *)anUsername journal:(NSString *)aJournal password:(NSString *)aPassword;
- (int)postEntry:(LJEntry *)anEntry password:(NSString *)aPassword;

@end
